<%-- 
    Document   : Commander
    Created on : 8 déc. 2012, 13:55:23
    Author     : Vinu
--%>
<%@page import="com.myapp.struts.Personne"%>
<%@page import="java.sql.Connection"%>
<%@page import="com.myapp.persistance.BaseDeDonnee"%>
<%@page contentType="text/html" pageEncoding="UTF-8"
        import="java.util.List,com.myapp.struts.Film"
%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@include file="commun.jsp" %>
<%= entete("BOUTIKONLINE")%>
<%@include file="Header.jsp" %>
<div class="texte">
    <jsp:useBean id="panier" scope="session" class="com.myapp.struts.Panier"/>
    <jsp:useBean id="login" scope="session" class="com.myapp.struts.Login"/>
    
    
 
    
    <%

                    for ( int i=0; i < panier.size(); i++ )
                    {
                            Film film = new Film();
                            film= (Film) panier.getFilms().get(i);
                     }
            BaseDeDonnee bd = new BaseDeDonnee();
            Connection con = bd.connecter();
           
           int k = bd.getLastNumCommand(con);
            bd.createCommand(login, con, panier,"En attente"); 
           int j = bd.getLastNumCommand(con);
          if(k<j)
          {panier.delete();   
    %>
    <jsp:forward page="ConfirmationCommande.jsp" />
</div>
<%
    }
                     else{
               request.getSession().setAttribute("attention", "yes");
%>
 <jsp:forward page="login.jsp" />
 <%
    }
 %>

<%@include file="Pied.jsp" %>
